package com.edu.cuotibook.dao;

import com.edu.cuotibook.dao.mapper.WrongAnswerDao;
import com.edu.cuotibook.entity.pojo.WrongAnswer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class WrongAnswerDaoService {

    @Resource
    private WrongAnswerDao wrongAnswerDao;

    public int insert(WrongAnswer pojo){
        return wrongAnswerDao.insert(pojo);
    }

    public int insertSelective(WrongAnswer pojo){
        return wrongAnswerDao.insertSelective(pojo);
    }

    public int insertList(List<WrongAnswer> pojos){
        if (CollectionUtils.isEmpty(pojos)) {
           return 0;
        }
        return wrongAnswerDao.insertList(pojos);
    }

    public int update(WrongAnswer pojo){
        return wrongAnswerDao.update(pojo);
    }

    public List<WrongAnswer> selectByExamId(Long examId) {
        return wrongAnswerDao.selectByExamId(examId);
    }
}
